#include <assert.h>
#include <stdio.h>

#include <algorithm>
#include <numeric>
#include <vector>

using namespace std;

int n, sum;

#define MAXN (10 + 5)

int Mask[MAXN], Cur[MAXN], Next[MAXN];

void Read() { scanf("%d%d", &n, &sum); }

void Test() {
  n = 2;
  sum = 16;
}

int Compute3() {
  for (int i = 1; i <= n; ++i) {
    Cur[i] = Mask[i];
  }

  for (int len = n - 1; len != 0; --len) {
    for (int i = 1; i <= len; ++i) {
      Next[i] = Cur[i] + Cur[i + 1];
    }
    for (int i = 1; i <= len; ++i) {
      Cur[i] = Next[i];
    }
  }
  return Cur[1];
}

void Solve2() {
  for (int i = 1; i <= n; ++i) {
    Mask[i] = i;
  }

  do {
    int val = Compute3();
    if (val == sum) {
      break;
    }
  } while (next_permutation(Mask + 1, Mask + n + 1));
  for (int i = 1; i <= n; ++i) {
    printf("%d%s", Mask[i], i == n ? "\n" : " ");
  }
}

int main() {
  // Read();
  Test();
  Solve2();
  return 0;
}